\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{}\section{Introdunction\+To\+Algorithm\+:\+:Tree\+Algorithm\+:\+:Binary\+Tree\+Node$<$ T $>$ Struct Template Reference}
\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node$<$ T $>$@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node$<$ T $>$}}


Binary\+Tree\+Node：二叉树的节点，算法导论xx章xx节  




{\ttfamily \#include $<$binarytreenode.\+h$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef T \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a0967a0c85792f7b02a005eb1942d1bf5}{Key\+Type}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a6fbeeee0c4db4b2afd3398ca5379b390}{Binary\+Tree\+Node} ()
\begin{DoxyCompactList}\small\item\em 默认构造函数 \end{DoxyCompactList}\item 
\hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a511c3ca309c8e77045d360ddbba60455}{Binary\+Tree\+Node} (const T \&keyvalue)
\begin{DoxyCompactList}\small\item\em 显式构造函数 \end{DoxyCompactList}\item 
virtual std\+::string \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a85f633a95e16b767f01d3eb7a3b17997}{to\+\_\+string} ()
\begin{DoxyCompactList}\small\item\em to\+\_\+string\+:返回该节点的字符串描述 \end{DoxyCompactList}\item 
virtual std\+::string \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_abefbedeac57528fcfa60cfb1728998f7}{to\+\_\+xml} ()
\begin{DoxyCompactList}\small\item\em to\+\_\+xml\+:返回以该节点为根的子树的{\ttfamily xml}描述。 \end{DoxyCompactList}\item 
bool \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a117288aa11c36d94e85664d1599c8099}{is\+\_\+left\+\_\+child} ()
\begin{DoxyCompactList}\small\item\em is\+\_\+left\+\_\+child\+:判断本节点是否左子节点。 \end{DoxyCompactList}\item 
bool \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a90c90d98b01fd0ee1060e192cd5858ef}{is\+\_\+right\+\_\+child} ()
\begin{DoxyCompactList}\small\item\em is\+\_\+right\+\_\+child\+:判断本节点是否右子节点。 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
std\+::weak\+\_\+ptr$<$ \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{Binary\+Tree\+Node} $>$ \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_afa42d2a3e68838d17d1028fab12c71e1}{parent}
\item 
std\+::shared\+\_\+ptr$<$ \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{Binary\+Tree\+Node} $>$ \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3f84ee829fc539e004bf3be6eb8fb882}{lchild}
\item 
std\+::shared\+\_\+ptr$<$ \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{Binary\+Tree\+Node} $>$ \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_ae6dc3c9fce595c08cd3a31dba534fec3}{rchild}
\item 
T \hyperlink{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3bcf52447a097b51caa74488e90f1479}{key}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename T$>$struct Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node$<$ T $>$}

Binary\+Tree\+Node：二叉树的节点，算法导论xx章xx节 

任何一个节点都有两个强引用指向左右子节点，以及一个弱引用指向它的父节点。节点还有一个{\ttfamily key}成员包含具体的数据 

Definition at line 13 of file binarytreenode.\+h.



\subsection{Member Typedef Documentation}
\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a0967a0c85792f7b02a005eb1942d1bf5}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!Key\+Type@{Key\+Type}}
\index{Key\+Type@{Key\+Type}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{Key\+Type}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ typedef T {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::{\bf Key\+Type}}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a0967a0c85792f7b02a005eb1942d1bf5}
节点保存的数据的类型 

Definition at line 32 of file binarytreenode.\+h.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a6fbeeee0c4db4b2afd3398ca5379b390}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!Binary\+Tree\+Node@{Binary\+Tree\+Node}}
\index{Binary\+Tree\+Node@{Binary\+Tree\+Node}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{Binary\+Tree\+Node()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::{\bf Binary\+Tree\+Node} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a6fbeeee0c4db4b2afd3398ca5379b390}


默认构造函数 

所有的成员变量都采取默认值 

Definition at line 20 of file binarytreenode.\+h.

\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a511c3ca309c8e77045d360ddbba60455}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!Binary\+Tree\+Node@{Binary\+Tree\+Node}}
\index{Binary\+Tree\+Node@{Binary\+Tree\+Node}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{Binary\+Tree\+Node(const T \&keyvalue)}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::{\bf Binary\+Tree\+Node} (
\begin{DoxyParamCaption}
\item[{const T \&}]{keyvalue}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a511c3ca309c8e77045d360ddbba60455}


显式构造函数 


\begin{DoxyParams}{Parameters}
{\em keyvalue\+:节点要保存的数据内容} & 指定{\ttfamily key}成员需要赋值的数据 \\
\hline
\end{DoxyParams}


Definition at line 29 of file binarytreenode.\+h.



\subsection{Member Function Documentation}
\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a117288aa11c36d94e85664d1599c8099}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!is\+\_\+left\+\_\+child@{is\+\_\+left\+\_\+child}}
\index{is\+\_\+left\+\_\+child@{is\+\_\+left\+\_\+child}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{is\+\_\+left\+\_\+child()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ bool {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::is\+\_\+left\+\_\+child (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a117288aa11c36d94e85664d1599c8099}


is\+\_\+left\+\_\+child\+:判断本节点是否左子节点。 

\begin{DoxyReturn}{Returns}
返回{\ttfamily true}或者{\ttfamily false} 该函数判断本节点是否是左子节点。如果本节点的父节点为空，则返回{\ttfamily false}；如果本节点的父节点非空且本节点是父节点的左子节点，则返回{\ttfamily true}；否则返回{\ttfamily false} 
\end{DoxyReturn}


Definition at line 80 of file binarytreenode.\+h.

\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a90c90d98b01fd0ee1060e192cd5858ef}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!is\+\_\+right\+\_\+child@{is\+\_\+right\+\_\+child}}
\index{is\+\_\+right\+\_\+child@{is\+\_\+right\+\_\+child}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{is\+\_\+right\+\_\+child()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ bool {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::is\+\_\+right\+\_\+child (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a90c90d98b01fd0ee1060e192cd5858ef}


is\+\_\+right\+\_\+child\+:判断本节点是否右子节点。 

\begin{DoxyReturn}{Returns}
返回{\ttfamily true}或者{\ttfamily false} 该函数判断本节点是否是右子节点。如果本节点的父节点为空，则返回{\ttfamily false}；如果本节点的父节点非空且本节点是父节点的右子节点，则返回{\ttfamily true}；否则返回{\ttfamily false} 
\end{DoxyReturn}


Definition at line 94 of file binarytreenode.\+h.

\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a85f633a95e16b767f01d3eb7a3b17997}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!to\+\_\+string@{to\+\_\+string}}
\index{to\+\_\+string@{to\+\_\+string}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{to\+\_\+string()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ virtual std\+::string {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::to\+\_\+string (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a85f633a95e16b767f01d3eb7a3b17997}


to\+\_\+string\+:返回该节点的字符串描述 

\begin{DoxyReturn}{Returns}
\+: 本节点的描述字符串
\end{DoxyReturn}
该函数打印本节点的{\ttfamily key}，以及父节点（若存在）、子节点（若存在）的{\ttfamily key} 

Definition at line 39 of file binarytreenode.\+h.

\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_abefbedeac57528fcfa60cfb1728998f7}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!to\+\_\+xml@{to\+\_\+xml}}
\index{to\+\_\+xml@{to\+\_\+xml}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{to\+\_\+xml()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ virtual std\+::string {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::to\+\_\+xml (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_abefbedeac57528fcfa60cfb1728998f7}


to\+\_\+xml\+:返回以该节点为根的子树的{\ttfamily xml}描述。 

\begin{DoxyReturn}{Returns}
\+: 本节点子树的{\ttfamily xml}描述的字符串
\end{DoxyReturn}
该函数返回以本节点为根的子树的{\ttfamily xml}描述。对子节点递归调用从而生成{\ttfamily xml}数据 

Definition at line 60 of file binarytreenode.\+h.



\subsection{Member Data Documentation}
\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3bcf52447a097b51caa74488e90f1479}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!key@{key}}
\index{key@{key}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{key}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ T {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::key}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3bcf52447a097b51caa74488e90f1479}
节点的保存的数据 

Definition at line 106 of file binarytreenode.\+h.

\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3f84ee829fc539e004bf3be6eb8fb882}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!lchild@{lchild}}
\index{lchild@{lchild}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{lchild}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\+::shared\+\_\+ptr$<${\bf Binary\+Tree\+Node}$>$ {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::lchild}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3f84ee829fc539e004bf3be6eb8fb882}
节点的左子节点的强引用 

Definition at line 104 of file binarytreenode.\+h.

\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_afa42d2a3e68838d17d1028fab12c71e1}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!parent@{parent}}
\index{parent@{parent}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{parent}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\+::weak\+\_\+ptr$<${\bf Binary\+Tree\+Node}$>$ {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::parent}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_afa42d2a3e68838d17d1028fab12c71e1}
节点的父节点的弱引用 

Definition at line 103 of file binarytreenode.\+h.

\hypertarget{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_ae6dc3c9fce595c08cd3a31dba534fec3}{}\index{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!rchild@{rchild}}
\index{rchild@{rchild}!Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{rchild}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\+::shared\+\_\+ptr$<${\bf Binary\+Tree\+Node}$>$ {\bf Introdunction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ T $>$\+::rchild}\label{struct_introdunction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_ae6dc3c9fce595c08cd3a31dba534fec3}
节点的右子节点的强引用 

Definition at line 105 of file binarytreenode.\+h.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/tree\+\_\+algorithms/binarytreenode/\hyperlink{binarytreenode_8h}{binarytreenode.\+h}\end{DoxyCompactItemize}
